package com.changgou.user.feign;

import com.changgou.user.pojo.User;
import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhengjd
 * @date 2020/5/17 21:49
 */
@FeignClient(name = "user")
@RequestMapping("user")
public interface UserFeign {

    /***
     * 根据ID查询User数据
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    Result<User> findById(@PathVariable(name="id") String id);

    /**
     * 更新用户积分
     * @param username
     * @param points
     * @return
     */
    @PostMapping("/points/add")
    Result addPoints(@RequestParam(name="username") String username,
                            @RequestParam(name="points") Integer points);
}
